﻿<UserControl x:Class="SSRSTestGenerator.UserControls.BuildAssertions"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
             xmlns:local="clr-namespace:SSRSTestGenerator.UserControls"
             xmlns:models="clr-namespace:SSRSTestGenerator.Models"
             Loaded="UserControl_Loaded"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">

    <UserControl.Resources>
        <DataTemplate DataType="{x:Type models:NodeDetails}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Attributes}"/>                
            </StackPanel>
        </DataTemplate>
    </UserControl.Resources>
    
    <Grid Name="buildAsertGrid">
        <Border Margin="5" BorderBrush="Blue" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8">
            <Border.Background>
                <LinearGradientBrush EndPoint="0.504,1.5" StartPoint="0.504,0.03">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Offset="0" Color="LightBlue" />
                        <GradientStop Offset="0.25" Color="White" />
                        <GradientStop Offset="0.4" Color="WhiteSmoke" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Border.Background>

            <DockPanel>
                <StackPanel Width="Auto" Height="auto" DockPanel.Dock="Top" Orientation="Vertical" VerticalAlignment="Top">
                    <StackPanel Margin="5">
                        <Border BorderBrush="White" BorderThickness="4" Width="auto" Height="auto">
                                <Grid>                                
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="7*"></RowDefinition>
                                    <RowDefinition Height="2*"></RowDefinition>                                    
                                </Grid.RowDefinitions>
                                
                                <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch"  Grid.Row="0" MaxHeight="490">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="6*"></ColumnDefinition>
                                        <ColumnDefinition Width="4*"></ColumnDefinition>                                        
                                    </Grid.ColumnDefinitions>                                    
                                    
                                    <TreeView Name="trViewReportXml" HorizontalContentAlignment="Stretch"  ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True" Grid.Row="0" Grid.Column="0"  SelectedItemChanged="trViewReportXml_SelectedItemChanged" GotFocus="trViewReportXml_GotFocus" Margin="5"/>
                                    <ListBox Name="lstBoxAssertions" GotFocus="lstBoxAssertions_GotFocus" SelectionChanged="lstBoxAssertions_SelectionChanged" Grid.Row="0" Grid.Column="1"  ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" Margin="5" />                                    
                                </Grid>                                                               

                                <Border Name="bdrAssertion" Visibility="Visible" VerticalAlignment="Center" Margin="5" BorderBrush="blue" BorderThickness="2" Width="auto" Height="auto" Grid.Row="1" CornerRadius="10">
                                    <WrapPanel HorizontalAlignment="Center">
                                        <ComboBox Name="cboElements" Margin="5" Width="auto"  MinWidth="150"></ComboBox>                                        
                                        <ComboBox Name="cboAssertions" Margin="5" MinWidth="150"                                                
                                              ItemsSource="{Binding Path=Assertions}"
                                              DisplayMemberPath="AssertionName"
                                              SelectedValuePath="IsAssertionNeedingValue"
                                              SelectedValue="{Binding Path=Assertions}">                                            
                                        </ComboBox>
                                        <TextBox Name="txtBxValue" Margin="5" MinWidth="200"></TextBox>
                                       
                                        <Button Height="23" MinWidth="70" Name="btnAdd" Visibility="Visible" Click="btnAdd_Click" >
                                            <DockPanel>
                                                <Image Height="15" Width="15" Source="/Images/16x16-Add.png" Margin="1,0,5,0"/>
                                                <TextBlock VerticalAlignment="center" Text="Add"/>                                                                                                    
                                            </DockPanel>
                                        </Button>

                                        <Button Height="23" MinWidth="70" Name="btnDelete" Visibility="Visible" Click="btndelete_Click" >
                                            <DockPanel>
                                                <Image Height="15" Width="15" Source="/Images/16x16Delete.png" Margin="1,0,5,0"/>
                                                <TextBlock VerticalAlignment="center" Text="Delete"/>
                                            </DockPanel>
                                        </Button>

                                        <Button Height="23" MinWidth="70" Name="btnUpdate" Visibility="Collapsed" Click="btnUpdate_Click" >
                                            <DockPanel>
                                                <Image Height="15" Width="15" Source="/Images/16x16-Update.png" Margin="1,0,5,0"/>
                                                <TextBlock VerticalAlignment="center" Text="Update"/>
                                            </DockPanel>
                                        </Button>

                                        <!--<Button Name="btndelete"  Content="Delete" Visibility="Visible" MinWidth="30"  Margin="5" Click="btndelete_Click"/>-->
                                        <!--<Button Name="btnUpdate" Content="Update" Visibility="Collapsed" MinWidth="30"  Margin="5" Click="btnUpdate_Click"/>-->
                                    </WrapPanel>
                                </Border>

                                <!--<Button Name="btnGenerateCode" Content="Generate Code" Width="100"  Grid.Row="2" Grid.Column="0" ></Button>-->
                            </Grid>
                            
                        </Border>
                    </StackPanel>

                </StackPanel>
            </DockPanel>
        </Border>
    </Grid>
</UserControl>
